package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.domain.VersionEntity;
import com.ruoyi.system.service.VersionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@Tag(name = "app版本控制")
@RequestMapping("/version")
public class VersionController {

    @Resource
    private VersionService versionService;

    @Operation(summary = "获取最新版本")
    @GetMapping("/lastVersion")
    public R<VersionEntity> lastVersion(@RequestParam("id") Integer id) {
        return R.ok(versionService.lastVersion(id));
    }


}
